package com.spzx.cloud.feign.api;

import com.spzx.cloud.entity.User;
import com.spzx.cloud.feign.config.DefaultFeignConfiguration;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

// 声明当前接口是一个访问 user-service 的 feign 的客户端
@FeignClient(value = "spzx-cloud-user", configuration = DefaultFeignConfiguration.class)
public interface UserFeignClient {

    // 根据 userId 查询用户信息的接口方法
    @GetMapping("/api/user/findUserByUserId/{userId}")
    User queryById(@PathVariable("userId") Long userId);

}